from pydantic import BaseModel, BeforeValidator
from typing_extensions import Annotated

def check_page_size(v: str) -> str:
    assert v.isdigit(), "page_size: please enter a number"
    return v or '10'

def check_offset(v: str) -> str:
    assert v.isdigit(), "page_size: please enter a number"
    return str((int(v) - 1) * 10)

class PaginateQueryParamsSchema(BaseModel):
    limit: Annotated[str,BeforeValidator(check_page_size)]
    offset: Annotated[str, BeforeValidator(check_offset)]

class PaginateParamsParamsSchema(BaseModel):
    query_params: dict

